import React, { useEffect, useRef } from 'react'
import * as echarts from 'echarts';

function Site() {
    const ref = useRef();

    useEffect(() => {
        var chartDom = ref.current;
        var myChart = echarts.init(chartDom);
        var option;

        option = {
            xAxis: {
                type: 'category',
                data: []
            },
            yAxis: {
                type: 'value'
            },
              grid: {
                left: '3%',
                right: '4%',
                top: '5%',
                containLabel: true
            },
            series: [
                {
                    data: [120, 200, 150, 80, 70, 110, 130],
                    type: 'bar',
                    showBackground: true,
                    backgroundStyle: {
                        color: 'rgba(180, 180, 180, 0.2)'
                    }
                }
            ]
        };

        option && myChart.setOption(option);

    }, [])
    return (
        <div className="Site" ref={ref} style={{ width: '500px', height: '250px' }}>

        </div>
    )
}

export default Site
